package org.openharmony.qttool;

import javax.swing.*;
import javax.swing.event.ListDataListener;

class QtSDKModel implements ComboBoxModel<QtSDK> {

    private final QtSDKManager qtSDKManager;
    private QtSDK selectedSDK;

    public QtSDKModel(QtSDKManager manager) {
        qtSDKManager = manager;
        if (qtSDKManager.count() != 0)
            selectedSDK = qtSDKManager.get(0);
    }

    @Override
    public void setSelectedItem(Object anItem) {
        selectedSDK = (QtSDK) anItem;
    }

    @Override
    public Object getSelectedItem() {
        return selectedSDK;
    }

    @Override
    public int getSize() {
        return qtSDKManager.count();
    }

    @Override
    public QtSDK getElementAt(int index) {
        return qtSDKManager.get(index);
    }

    @Override
    public void addListDataListener(ListDataListener l) {

    }

    @Override
    public void removeListDataListener(ListDataListener l) {

    }
}
